import logging
import logging.config

class Logger(object):
    def __init__(self,conf_file,loggername):
        logging.config.fileConfig(conf_file)
        self.logger = logging.getLogger("main."+loggername)
    def debug(self,message):
        self.logger.debug(message)

    def info(self,message):
        self.logger.info(message)
 
    def war(self,message):
         self.logger.warn(message)
 
    def error(self,message):
        self.logger.error(message)
 
    def cri(self,message):
        self.logger.critical(message)
 
if __name__ =='__main__':
    log = Logger('log.config','main')
    log.debug('debug')
    log.info("info")
    log.war('warning')
    log.error('error')
    log.cri('critical')
